package org.blitengine.camera
{
	import flash.geom.Point;
	
	import org.blitengine.objects.BlitObject;
	
	public class Camera extends Point
	{
		private var _target:BlitObject;
		public var ease:Number = .1;
		
		public function Camera(x:int = 0, y:int = 0)
		{
			super(x, y);
		}
		
		public function get target():BlitObject
		{
			return _target;
		}
		
		public function set target(target:BlitObject):void
		{
			_target = target;
		}
		
		public function update():void
		{
			if(_target != null) 
			{
				x += (_target.x - x)*ease;
				y += (_target.y - y)*ease;
			}
		}
	}
}